let buf = Buffer.alloc(1024*1024*256); //分配4k 缓存
for(let i = 0; i != 1024*1024*4;i++){
    buf[i] = Math.random()*90 + 0x20;
}
let str = buf.toString('utf-8');
let now1 = Date.now();
let pos = 0;
while(-1 != (pos = str.indexOf('a',pos))){
    pos++;
}
console.log(Date.now() - now1);
now1 = Date.now();
str.matchAll(/a/g);
console.log(Date.now() - now1);
